/*
 * Author Hung Tran
 */
package viettravel.guiandevent;

import viettravel.common.Constants;
import viettravel.guiandevent.R;
import android.graphics.Typeface;
import android.os.Bundle;
import android.widget.TextView;

import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.app.SherlockActivity;
import com.actionbarsherlock.view.MenuItem;

public class InformationActivity extends SherlockActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		setTheme(Constants.THEME);
		super.onCreate(savedInstanceState);
		setContentView(R.layout.layout_information);

		ActionBar actionBar = getSupportActionBar();
		actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
		actionBar.setDisplayHomeAsUpEnabled(false);
		actionBar.setHomeButtonEnabled(true);
		actionBar.setIcon(R.drawable.ic_back_arrow);
		actionBar.setTitle(R.string.information_title);
		actionBar.setBackgroundDrawable(Constants.APP_DRAWABLE);

		Typeface tf = Typeface.createFromAsset(getAssets(),
				"fonts/utm_nyala.ttf");

		TextView website = (TextView) findViewById(R.id.infomationWebsite);
		website.setText(Constants.WEBSITE);
		website.setTypeface(tf);

		TextView version = (TextView) findViewById(R.id.informationVersion);
		version.setText("Version " + Constants.APP_VERSION);
		version.setTypeface(tf);

	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		switch (item.getItemId()) {
		case android.R.id.home: {
			finish();
			return true;
		}
		default:
			return super.onOptionsItemSelected(item);
		}
	}

}
